Provides read-only access to the files contained within a single package that is stored in a zipped file on the file system.
Namespace: Microsoft.LearningComponents
Assembly: Microsoft.LearningComponents.dll
| C# |
|
public class ZipPackageReader : PackageReader |
| Name | Description | |
| Ð | ZipPackageReader (Stream) | Initializes a new instance of the |
| Ð | ZipPackageReader (string) | Initializes a new instance of the |
| Ð | ZipPackageReader (string, ImpersonationBehavior) | Initializes a new instance of the |
| Name | Description | |
| ÐS | Create | Returns either a ZipPackageReader or LrmPackageReader, according to the type of package provided. Inherited from PackageReader. |
| Ð | CreateManifestNavigator () | Returns an XPathNavigator that points to the <manifest> node of the package manifest. Inherited from PackageReader. |
| Ï | Dispose | Releases all resources used by this object |
| Ð | Dispose () | This method supports the .NET Framework infrastructure and is not intended to be used directly from your code. Releases all resources used by the PackageReader. Inherited from PackageReader. |
| Ð | FileExists | Gets a value indicating whether a file exists in the zipped package. |
| Ð | GetFilePaths | Gets the collection of file paths in the package. |
| Ð | GetFileStream | Returns a System.IO.Stream for the file inside the zipped package referenced by filePath. |
| Ð | TransmitFile | Writes a file directly to a web page response. This method should be used whenever possible, as it has much better performance than reading a file into a stream and copying it to the response. |
The zipped package can be stored on the local hard drive, removable storage, or on a network file share accessible via a mapped drive letter or UNC path. However, note that performance may be very poor if the file name is a UNC path.
This class can be used to import a package contained in a zipped file, or for instance to access the contents of a zipped package.
The zipped package is unzipped to a temporary directory on the first call to FileExists or GetFileStream. This temporary directory is maintained for the life of the ZipPackageReader, and is deleted in the Dispose or finalizer.
See PackageReader for examples of how classes based on PackageReader (such as this one) can be used.
The ZipPackageReader class calls unmanaged code. Since this assembly is used in the GAC, it has unmanaged code permissions implicitly.
The FileSystemPackageReader and ZipPackageReader classes both require FileIOPermission to write to the file system. Again, this is implicit as this assembly is a "full trust" assembly.